package com.coolw.core.generic;

import lombok.Data;

/**
 * 泛型类
 *
 * @author coolw
 * @date 2023/12/22 11:32
 */
@Data
public class GenericClass<T> {

    private T data;

    // 编译报错
    /*public static T test() {

    }*/

    public static void main(String[] args) {
        GenericClass<String> gs1 = new GenericClass<>();
        gs1.setData("hello");
        System.out.println(gs1.getData());

        GenericClass<Integer> gs2 = new GenericClass<>();
        gs2.setData(11);
        System.out.println(gs2.getData());
    }
}
